PROG = multithreaded_restful_server
SOURCES = $(PROG).c ../../fossa.c
APP_FLAGS = -DNS_ENABLE_THREADS $(CFLAGS_EXTRA)

ifeq ($(OS), Windows_NT)
APP_FLAGS += advapi32.lib
endif

all: $(PROG)

$(PROG): $(SOURCES)
	$(CC) $(SOURCES) -o $@ -W -Wall -I../.. -pthread $(APP_FLAGS)

$(PROG).exe: $(SOURCES)
	cl $(SOURCES) /I../.. /MD /Fe$@ $(APP_FLAGS)

clean:
	rm -rf *.gc* *.dSYM *.exe *.obj *.o a.out $(PROG)
